#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <cstring>
using namespace std;
class Person {
    char name[10];
    int age;
    char sex;
public:

    void Register(const char* s, int n , char c) {
        strcpy(name, s);
        age = n; sex = (c == 'm' ? 0 : 1);
    }
    char* getName() { return name; }
    char getSex() { return sex == 0 ? 'm' : 'f'; }
    int getAge() { return age; }
    void showme() {
        cout << getName() << " " << getSex() << " " << getAge() << " ";
    }
};
class Teacher :public Person
{
    char specialty[15];
    char position[10];
    char majorCourse[10];
public:
    Teacher(const char* s = "XXX", int n = 0,   char m = 'm', const char* sp = "XXX", const char* p = "XXX", const char* mj = "XXX")
    {
        strcpy(specialty, sp);
        strcpy(position, p);
        strcpy(majorCourse, mj);
        Register(s, n, m);
    }
        void teacherRegister(const char* s, int n, char m,const char* sp,const char* p,const char* mj)
    {
            strcpy(specialty, sp);
            strcpy(position, p);
            strcpy(majorCourse, mj);
            Register(s, n, m);

    }
        void showMe()
        {
            showme();
            cout << specialty << ' ' << position << ' ' << majorCourse<<endl;
        }
};

int main() {
    Teacher t;
    t.showMe();
    t.teacherRegister("Zhang", 38, 'f', "Computer", "Professor", "C++");
    t.showMe();
    return 0;
}